// pages/creditCardCreate/index.js
import { inputgetName } from '../../utils/inputBothBind.js'

Page({
  data: {
    stepText: ["1.卡号信息", "2.安全码", "3.信用卡有效期"],
    cardType: {
      name: '',
      id: 10
    },
    cardNum:'666',
    validDt:'777'
  },
  inputgetName: inputgetName,
  toSelectCardType: function() {
    console.log("66666")
    wx.navigateTo({
      // TODO
      url: ""
    })
  },
  toBankCardOCR: function() {
    console.log("bankcard OCR")
    // TODO
  },
  toSelectValidDt:function() {
    // TODO
    console.log("选择有效期")
  },
  toNext:function() {
    // TODO
    if(!this.data.cardNum || !this.data.validDt || !this.data.cardType.id) {
      wx.showToast({
        title: '请填写完整',
        icon: 'none'
      })
      return
    }
    wx.navigateTo({
      url: `/pages/creditCardCreateStep2/index?cardNum=${this.data.cardNum}&validDt=${this.data.validDt}&bankId=${this.data.cardType.id}`,
    })
  },
  onLoad: function (options) {

  },
  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {

  },
  onUnload: function () {

  },
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})